package cn.itcast.dtx.seatademo.bank1.controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;@RestControllerpublic class TestController {    private int num = 0;    //这个写法等效于下面的写法    private final ThreadLocal<Integer> threadLocal = ThreadLocal.withInitial(() -> num);    /*private final ThreadLocal<Integer> threadLocal = new ThreadLocal<Integer>(){        @Override        protected Integer initialValue() {            return num;        }    };*/    @RequestMapping("/addNum")    public void addNum() {        int unum = threadLocal.get();        threadLocal.set(++unum);        System.out.println(threadLocal.get());    }}